using SuperSocket;
using SuperSocket.ProtoBase;
using SuperSocket.Command;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

[Command(Key="add")]
public class ADD : IAsyncCommand<StringPackageInfo>
{
    public async ValueTask ExecuteAsync(IAppSession session, StringPackageInfo package)
    {
        var result = package.Parameters
            .Select(p => int.Parse(p))
            .Sum();

        await session.SendAsync(Encoding.UTF8.GetBytes(result.ToString() + "\r\n"));
    }
}